<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/10/22
 * Time: 10:49
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\admin\controller;

use app\common\lib\Show;
use app\common\lib\Status;
use think\facade\Session;
use think\facade\View;

class Index extends Base
{
    public function index(){
        return $this->fetch();
    }
    public function logout(){
        Session::set(config('admin.admin_session_key'),null);
        return Show::json_show(Status::status_normal,"退出成功");
    }
    public function getSystemInit(){
        try {
            $menuInfo = (new \app\common\business\Menu())->getSystemInit();
        }catch (\Exception $e){
            return Show::json_show(Status::status_error,"发生错误");
        }
        return json($menuInfo);
    }
}